<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>友链新增</title>

  <link rel="shortcut icon" th:href="@{/images/favicon.ico}" />
  <link rel="stylesheet" href="../../static/lib/Semantic-UI/semantic.min.css" th:href="@{/lib/Semantic-UI/semantic.min.css}">
  <link rel="stylesheet" href="../../static/css/me.css" th:href="@{/css/me.css}">
</head>
<body>

  <!--导航栏-->
  <nav class="ui inverted gird-header" >
    <div class="ui container">
      <div class="ui inverted secondary stackable menu">
        <h2 class="ui olive header item" style="font-family: STSong">SUOYUEの管理后台</h2>
        <a href="#" th:href="@{/admin/blogs}" class="m-item item m-mobile-hide"><i class="home icon"></i>文章管理</a>
        <a href="#" th:href="@{/admin/types}" class="m-item item m-mobile-hide"><i class="clone outline icon"></i>分类管理</a>
        <a href="#" th:href="@{/admin/friendlinks}" class="m-item active item m-mobile-hide"><i class="pencil alternate icon"></i>友链管理</a>
        <a href="#" th:href="@{/admin/images}" class="m-item item m-mobile-hide"><i class="images icon"></i>图片管理</a>
        <div class="right m-item m-mobile-hide menu">
          <div class="ui dropdown  item">
            <div class="text">
              <img class="ui avatar image" src="../../static/images/me.jpg" th:src="@{/images/me.jpg}">
              <span th:text="${session.user.nickname}">suoyue_zhan</span>
            </div>
            <i class="dropdown icon"></i>
            <div class="menu">
              <a href="" th:href="@{/admin/logout}" class="item">注销</a>
            </div>
          </div>
        </div>
      </div>
    </div>
  </nav>
  <div class="m-padded-tb-hugex">
    <div class="ui attached pointing menu">
      <div class="ui container">
        <div class="right menu">
          <a href="#" th:href="@{/admin/friendlinks/input}" class="active item">发布</a>
          <a href="#" th:href="@{/admin/friendlinks}" class="teal item">列表</a>
        </div>
      </div>
    </div>
  </div>

  <!--中间内容-->
  <div  class="m-container-small m-padded-tb-massive">
    <div class="ui container">
      <form action="#" th:action="${friendlink.id}==null ? @{/admin/friendlinks} : @{/admin/friendlinks/{id}(id=${friendlink.id})}" method="post" class="ui form">
        <input type="hidden" name="id" th:value="${friendlink.id}">
        <div class=" field">
          <div class="ui left labeled input m-margin-top">
            <label class="ui teal basic label">博客名称</label>
            <input type="text" name="blogname" placeholder="博客名称" th:value="${friendlink.blogname}">
          </div>
          <div class="ui left labeled input m-margin-top">
            <label class="ui teal basic label">网址类型</label>
            <input type="text" name="uid" placeholder="0-自荐 1-友链" th:value="${friendlink.uid}">
          </div>
          <div class="ui left labeled input m-margin-top">
            <label class="ui teal basic label">博客地址</label>
            <input type="text" name="blogaddress" placeholder="博客地址" th:value="${friendlink.blogaddress}">
          </div>
          <div class="ui left labeled input m-margin-top">
            <label class="ui teal basic label">图片地址</label>
            <input type="text" name="pictureaddress" placeholder="图片地址" th:value="${friendlink.pictureaddress}">
          </div>
        </div>

        <div class="ui error message"></div>
        <div class="ui mini negative message" th:text="${message}">提示：不能添加重复的友链</div>
        <div class="ui right aligned container">
          <button type="button" class="ui button" onclick="window.history.go(-1)" >返回</button>
          <button class="ui teal submit button">提交</button>
        </div>

      </form>
    </div>
  </div>

  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>

<!--底部栏-->
<footer class="ui inverted vertical segment m-padded-tb-massive m-opacity" th:replace="_fragments :: footer">
  <!--容器-->
</footer>

  <script src="../../static/js/jquery.min.js" th:src="@{/js/jquery.min.js}"></script>
  <script src="../../static/lib/Semantic-UI/semantic.min.js" th:src="@{/lib/Semantic-UI/semantic.min.js}"></script>

  <script>
    $('.menu.toggle').click(function () {
      $('.m-item').toggleClass('m-mobile-hide');
    });

    $('.ui.dropdown').dropdown({
      on : 'hover'
    });

    $('.ui.form').form({
      fields : {
        blogname : {
          identifier: 'blogname',
          rules: [{
            type : 'empty',
            prompt: '请输入博客名称'
          }]
        },
        blogaddress : {
          identifier: 'blogaddress',
          rules: [{
            type : 'empty',
            prompt: '请输入博客地址'
          }]
        },
        pictureaddress : {
          identifier: 'pictureaddress',
          rules: [{
            type : 'empty',
            prompt: '请输入图片地址'
          }]
        }
      }
    });

  </script>
</body>
</html>